package com.cskaoyan.service.admin;

import com.cskaoyan.bean.common.CommonData;
import com.cskaoyan.bean.vo.admin.region.MarketRegionListVo;
import com.cskaoyan.mapper.MarketRegionMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 商场管理行政区域模块的service层实现
 *
 * @Author: zhang
 * @Date: 2022/11/19 20:27
 * @Since: jdk1.8
 */
@Service
public class MarketRegionServiceImpl implements MarketRegionService {
    @Autowired
    MarketRegionMapper marketRegionMapper;

    @Override
    public CommonData<MarketRegionListVo> list() {
        PageHelper.startPage(1, 31);
        List<MarketRegionListVo> marketRegionListVos = marketRegionMapper.selectAllRegions();
        PageInfo<MarketRegionListVo> pageInfo = new PageInfo<>(marketRegionListVos);
        return CommonData.data(pageInfo);
    }
}
